home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / NUBUS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  97 lines

  1.  
  2. struct nubus_slot
  3. {
  4.     int slot_flags;
  5. #define NUBUS_DEVICE_PRESENT    1
  6. #define NUBUS_DEVICE_ACTIVE    2
  7. #define NUBUS_DEVICE_IRQ    4
  8.     __u32 slot_directory;
  9.     __u32 slot_dlength;
  10.     __u32 slot_crc;
  11.     __u8  slot_rev;
  12.     __u8  slot_format;
  13.     __u8  slot_lanes;
  14.     /*
  15.      *    Stuff we pulled from the directory
  16.      */
  17.     __u32  slot_dirbase;
  18.     __u32  slot_thisdir;
  19.     char   slot_vendor[64];
  20.     char   slot_cardname[64];
  21. };
  22.  
  23. struct nbnamevec 
  24. {
  25.     char *name;
  26.     int id;
  27. };
  28.  
  29. struct nubus_dir
  30. {
  31.     unsigned char *base;
  32.     int length;
  33.     int count;
  34.     int mask;
  35. };
  36.  
  37. struct nubus_dirent
  38. {
  39.     unsigned char type;
  40.     int value;    /* Actually 24bits used */
  41.     int mask;
  42.     int base;    /* For dirptr function */
  43. };
  44.  
  45. struct nubus_type
  46. {
  47.     __u16 category;
  48.     __u16 type;
  49.     __u16 DrHW;
  50.     __u16 DrSW;
  51. };
  52.  
  53. #define NUBUS_CAT_BOARD            0x0001
  54. #define NUBUS_CAT_DISPLAY        0x0003
  55. #define NUBUS_CAT_NETWORK        0x0004
  56. #define NUBUS_CAT_COMMUNICATIONS    0x0006
  57. #define NUBUS_CAT_FONT            0x0009
  58. #define NUBUS_CAT_CPU            0x000A
  59.  
  60. #define RES_ID_TYPE        0x0001
  61. #define RES_ID_NAME        0x0002
  62. #define RES_ID_BOARD_DIR    0x0001
  63. #define RES_ID_FLAGS        0x0007
  64.  
  65. struct nubus_device_specifier
  66. {
  67.     int (*setup)(struct nubus_device_specifier *, int slot, struct nubus_type *);
  68.     struct nubus_device_specifier *next;
  69. };
  70.  
  71.  
  72. extern void register_nubus_device(struct nubus_device_specifier *nb);
  73. extern void unregister_nubus_device(struct nubus_device_specifier *nb);
  74.  
  75. extern struct nubus_dir *nubus_openrootdir(int slot);
  76. extern struct nubus_dir *nubus_opensubdir(struct nubus_dirent *d);
  77. extern void nubus_closedir(struct nubus_dir *);
  78. extern struct nubus_dirent *nubus_readdir(struct nubus_dir *);
  79. extern unsigned char *nubus_dirptr(struct nubus_dirent *d);
  80. extern void nubus_strncpy(int slot, void *to, unsigned char *p, int len);
  81. extern void nubus_memcpy(int slot, void *to, unsigned char *p, int len);
  82. extern void nubus_init(void);
  83. extern void nubus_sweep_video(void);
  84. extern int nubus_ethernet_addr(int slot, unsigned char *addr);
  85.  
  86. extern __inline void *nubus_slot_addr(int slot)
  87. {
  88.     return (void *)(0xF0000000|(slot<<24));
  89. }
  90.  
  91. extern int nubus_hwreg_present(volatile void *ptr);
  92.  
  93. extern void nubus_init_via(void);
  94. extern int nubus_free_irq(int slot);
  95. extern int nubus_request_irq(int slot, void *dev_id, void (*handler)(int,void *,struct pt_regs *));
  96.  
  97.